this.showModelinfo = function() {
	/* CONFIG */
	xOffset = 10;
	yOffset = 20;
	// these 2 variable determine popup's distance from the cursor
	// you might want to adjust to get the right result
	/* END CONFIG */
	$("a.model-info-tooltip").hover(
			function(e) {
				this.t = this.title;
				this.tt = retrieveModelInfo(this.t);
				this.title="";
				$("body").append("<p id='tooltip'>" + this.tt + "</p>");
				$("#tooltip").css("top", (e.pageY - xOffset) + "px").css(
						"left", (e.pageX + yOffset) + "px").fadeIn("fast");
			}, function() {
				this.title = this.t;
				$("#tooltip").remove();
			});
	$("a.model-info-tooltip").mousemove(
			function(e) {
				$("#tooltip").css("top", (e.pageY - xOffset) + "px").css(
						"left", (e.pageX + yOffset) + "px");
			});
};

function retrieveModelInfo(model) {
	$.get("http://localhost:8080/vehicle-model-info/info", "model="+model, function(data) {
		$('#tooltip').html(data.info);
	}, "json");

}

$.ajaxSetup ({
	cache: false
});

// starting the script on page load
$(document).ready(function() {
	showModelinfo();
	$("#error").fadeIn("slow");
    $("#error a.close-notify").click(function() {
        $("#message").fadeOut("slow");
        return false;
    });
});

function disableOthers(me){
	var selectors = document.forms[0].sel;
	if(selectors[0] == me){
		document.forms[0].vin.disabled = false;
		document.forms[0].vehicleNumber.disabled = true;
		document.forms[0].make.disabled = true;
		document.forms[0].model.disabled = true;
	} else if(selectors[1] == me){
		document.forms[0].vehicleNumber.disabled = false;
		document.forms[0].vin.disabled = true;
		document.forms[0].make.disabled = true;
		document.forms[0].model.disabled = true;
	} else if(selectors[2] == me){
		document.forms[0].make.disabled = false;
		document.forms[0].model.disabled = false;
		document.forms[0].vehicleNumber.disabled = true;
		document.forms[0].vin.disabled = true;
	}
	
}
